<template>
	<view class="title_bar">
		<view class="title">{{ titleInfo.title }}</view>
		<view class="more" @click="more(titleInfo.url)">
			更多
			<u-icon name="arrow-right" color="#666666" size="14"></u-icon>
		</view>
	</view>
</template>

<script>
export default {
	name: 'home_title',
	props: {
		titleInfo: {
			type: Object,
			default: {}
		}
	},
	data() {
		return {};
	},
	methods: {
		more() {
			if (this.titleInfo.type == 1) {
				uni.switchTab({ url: this.titleInfo.url })
			} else {
				uni.navigateTo({ url: this.titleInfo.url })
			}
		}
	}
};
</script>

<style lang="scss">
.title_bar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 30rpx 0;

	.title {
		font-size: 40rpx;
		font-weight: 700;
		color: #333333;
		line-height: 42rpx;
	}

	.more {
		display: flex;
		align-items: center;
		font-size: 26rpx;
		font-weight: 400;
		color: #666666;
		line-height: 42rpx;
	}
}
</style>
